<template>
  <view class="addBank">
    <view class="addBank-item">
      <text>请输入对方账户ID</text>
      <view class="item-input">
        <input class="input" v-model="pam.shortid" placeholder="请输入对方ID" style="font-size: 25rpx;padding: 0 20rpx;" />
      </view>
    </view>
    <view class="addBank-item">
      <view class="row1">
        <text>请输入转账金额</text>
        <text>当前余额:  ￥{{zJine.cashAmount}}</text>
      </view>
      <view class="item-input">
        <input class="input" v-model="pam.amount" :placeholder="'最小转账金额：' + zJine.minAmount" style="font-size: 25rpx;padding: 0 20rpx;" />
      </view>
      <view class="allMoney">
        <text @click="pam.amount = zJine.cashAmount">全部余额</text>
      </view>
    </view>
    <view class="item-save"><button @click="sure" type="default">提交申请</button></view>
  </view>
</template>

<script>
export default {
  data() {
    return {
		zJine:{},
		pam:{
			shortid:'',
			amount:''
		}
	};
  },
  onShow() {
  	this.$ajax('api/Member/BalanceTransferInit').then(res => {
		this.zJine = res.Data
	})
  },
  methods:{
	  sure(){
		  if(this.pam.amount < this.zJine.minAmount){
			  uni.showToast({
			  	title: '转出金额必须大于最小转账金额:' +this.zJine.minAmount + '元',
				icon:'none'
			  });
			  return false
		  }
		  this.$ajax('api/Member/BalanceTransfer',this.pam).then(res => {
			  uni.showToast({
			  	title: '申请成功'
			  });
			  uni.navigateBack({
			  	
			  })
		  })
	  }
  }
};
</script>

<style lang="scss">
.addBank {
  padding-top: 56rpx;
  padding-left: 23.5rpx;
  .addBank-item {
    width: 690rpx;
    height: 132rpx;
    margin-bottom: 59rpx;
    text {
      color: #333333;
      font-size: 24rpx;
    }
    .row1 {
      display: flex;
      justify-content: space-between;
    }
    .item-input {
      .tips {
        color: #CFCFCF;
        font-size: 28rpx;
        margin-left: 26rpx;
      }
      height: 80rpx;
      border: 1rpx solid #c3c3c3;
      border-radius: 5rpx;
      display: flex;
      justify-content: space-between;
      margin-top: 26.5rpx;
      align-items: center;
    }
    .allMoney {
      display: flex;
      justify-content: flex-end;
      margin-top: 23.5rpx;
      text {
        color: #E5AD5B;
      }
    }
  }
  .item-save {
    width: 690rpx;
    height: 80rpx;
    // margin-left: 20.5rpx;
    font-size: 30rpx;
    text-align: center;
    line-height: 80rpx;
    background-color: #202029;
    // margin-top: 95rpx;
    margin-top: 99rpx;
    button {
      background-color: #202029;
      color: #ffffff;
      font-size: 30rpx;
    }
  }
}
.input{
	width: 100%;
}
</style>
